﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<%

    
    if (Request.IsAuthenticated) {
        try
        {
            //Pega os dados de usuario
            DNA.Models.DNAAnalysisEntities db = new DNA.Models.DNAAnalysisEntities();
            DNA.Models.User user = db.User.Single(u => u.Email == Page.User.Identity.Name);
        

        //Definir a Rota para Editar user!!! ???
%>
        Bem Vindo <strong><%: user.Name + " " + user.Lastname + "! Logado desde: " + Session["LogonDate"].ToString() %> <br /></strong>
        
        [ <%: Html.ActionLink("Meus Dados", "Edit","User", new { id=user.Id },null) %> ]
        [ <%: Html.ActionLink("Sair", "LogOff", "User") %> ]


<%
        }
        catch (Exception ex)
        {
            ex.Message.ToString();
        %> 
            [ <%: Html.ActionLink("Entrar", "LogOn", "User") %> ]
        <%
            
        }
    }
    else {
%> 
        [ <%: Html.ActionLink("Entrar", "LogOn", "User") %> ]
<%
    }
%>